<?php

require_once("FDMSsandbox.php");

$vitalsId = $_GET["vitalsId"];

// actual first thing we do is hit the login.jsp and actually log in
$results = keystone_FDMS_login( "kyony2", "kentucky" );
$jsessionid = $results['jsessionid'];

$results = fetch_FDMS_vitalsPage( $vitalsId, $jsessionid );
if($results['in_vitals_page'] == "yes")
{
    setcookie("JSESSIONID", $jsessionid);
	
	$head_contents = $results['page_head'];
	$body_contents = $results['page_body'];

	// don't forget to set the JSESSIONID cooke here...
	echo "<html><head>\n";
	echo $head_contents;
	echo "</head>\n";	
	echo "<body>\n";
	echo $body_contents;
	echo "</body></html>\n";	
}
else
{
    // send back to error page
    print "Error trying to fetch case for $vitalsId<br>";
}

?>
